package com.oscar.ehome.model;

import android.os.Build;
import android.util.Log;

import com.google.gson.Gson;
import com.oscar.ehome.base.BaseBean;
import com.oscar.ehome.base.C;
import com.oscar.ehome.bean.DownBean;
import com.oscar.ehome.bean.RateListBean;
import com.oscar.ehome.bean.UsersBean;
import com.oscar.ehome.bean.WeclomeBean;
import com.oscar.ehome.bean.loginbean.CodeBean;
import com.oscar.ehome.bean.loginbean.UserBean;
import com.oscar.ehome.bean.loginbean.idcardbean.ComitMessageBean;
import com.oscar.ehome.bean.loginbean.idcardbean.IdBean;
import com.oscar.ehome.bean.loginbean.idcardbean.IdCardBean;
import com.oscar.ehome.bean.loginbean.idcardbean.MessageBean;
import com.oscar.ehome.bean.loginbean.logincompanyBean;
import com.oscar.ehome.bean.messageBean.MessageDetailBean;
import com.oscar.ehome.bean.messageBean.MessageLeveBean;
import com.oscar.ehome.bean.messageBean.MessagesBean;
import com.oscar.ehome.bean.pagebean.AppListBean;
import com.oscar.ehome.bean.pagebean.BaoDanKehuBean;
import com.oscar.ehome.bean.pagebean.BaoDanTiaoBean;
import com.oscar.ehome.bean.pagebean.ClassRoomBean;
import com.oscar.ehome.bean.pagebean.ClassRoomPrombleBean;
import com.oscar.ehome.bean.pagebean.DaKaInfoBean;
import com.oscar.ehome.bean.pagebean.DaKaXiqngQingBean;
import com.oscar.ehome.bean.pagebean.DiaoChaInfo;
import com.oscar.ehome.bean.pagebean.DuDaoBean;
import com.oscar.ehome.bean.pagebean.DuDaoLieBiaoBean;
import com.oscar.ehome.bean.pagebean.DuDaoXiangQingBean;
import com.oscar.ehome.bean.pagebean.DuDaoZaohuiShuJU;
import com.oscar.ehome.bean.pagebean.HdBean;
import com.oscar.ehome.bean.pagebean.HuokeBean;
import com.oscar.ehome.bean.pagebean.InsuranceBean;
import com.oscar.ehome.bean.pagebean.InuranceMessageBean;
import com.oscar.ehome.bean.pagebean.MemberBean;
import com.oscar.ehome.bean.pagebean.MingpianBean;
import com.oscar.ehome.bean.pagebean.PageListBean;
import com.oscar.ehome.bean.pagebean.PageMessageBean;
import com.oscar.ehome.bean.pagebean.SginTwoMessageBean;
import com.oscar.ehome.bean.pagebean.ShouyeOFOBean;
import com.oscar.ehome.bean.pagebean.ShuJuHuixianBean;
import com.oscar.ehome.bean.pagebean.SignNameBean;
import com.oscar.ehome.bean.pagebean.StudyBean;
import com.oscar.ehome.bean.pagebean.StudyDetialBean;
import com.oscar.ehome.bean.pagebean.SubBaoDanShuJuBEan;
import com.oscar.ehome.bean.pagebean.TongJiMessageBean;
import com.oscar.ehome.bean.pagebean.WorkLogBean;
import com.oscar.ehome.bean.pagebean.WorkMessageBean;
import com.oscar.ehome.bean.pagebean.XiaoXiFinalBean;
import com.oscar.ehome.bean.pagebean.XiaoXiXiangQingBean;
import com.oscar.ehome.bean.pagebean.XuanXiangShuJuBean;
import com.oscar.ehome.bean.pagebean.XueXiFinalBean;
import com.oscar.ehome.bean.pagebean.XueXiListBean;
import com.oscar.ehome.bean.pagebean.XueXiMessageBean;

import com.oscar.ehome.bean.pagebean.YeJiListBean;
import com.oscar.ehome.bean.pagebean.YeJiXiangQingBean;
import com.oscar.ehome.bean.pagebean.ZaoHuiList;
import com.oscar.ehome.bean.pagebean.tuanduiBean;
import com.oscar.ehome.bean.pagebean.xuexifenleiBean;
import com.oscar.ehome.bean.setbean.AlipayBean;
import com.oscar.ehome.bean.setbean.FeedBackBean;
import com.oscar.ehome.bean.setbean.LearnHistoryBean;
import com.oscar.ehome.bean.setbean.PaySuccessBean;
import com.oscar.ehome.bean.setbean.SetMessageBean;
import com.oscar.ehome.bean.setbean.SginMessageBean;
import com.oscar.ehome.bean.setbean.SginchuqinBean;
import com.oscar.ehome.bean.setbean.TokenBean;
import com.oscar.ehome.bean.setbean.WeChatBean;
import com.oscar.ehome.bean.teamBean.TeamListBean;
import com.oscar.ehome.bean.teamBean.UpdateBean;
import com.oscar.ehome.bean.teamBean.UserAppInfoBean;
import com.oscar.ehome.bean.teamBean.UserRoleStaticBean;
import com.oscar.ehome.bean.teamBean.UserStartStaticBean;
import com.oscar.ehome.provider.okhttp.OkHttpUtils;
import com.oscar.ehome.provider.okhttp.callback.StringCallback;
import com.oscar.ehome.utils.util.AesUtils;
import com.oscar.ehome.utils.util.CommonUtils;
import com.oscar.ehome.utils.util.makeTime;
import net.tycmc.bulb.androidstandard.utils.JsonUtils;
import org.apache.commons.collections.MapUtils;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.Call;

public class HttpModelImple implements HttpModel {


    @Override
    public void getyaoqinginfo(String token, final OnHttpListener listener) {
        try {
            String url = C.mingpianinfo;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("yaoqing", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MingpianBean> baseBean = BaseBean.fromJson(response, MingpianBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        Log.e("yaoqing", "onResponse: " + "1");
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        Log.e("yaoqing", "onResponse: " + "1");
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("tiaoguo");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void subyaoqing(String token, String name, String introduction, String time, String image, String qrCode, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.mingpianfankui)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("name", name)
                    .addParams("introduction", introduction)
                    .addParams("time", time)
                    .addParams("image", image)
                    .addParams("qrCode", qrCode)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("Dudaoliebiao", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                FeedBackBean feedBackBean = new Gson().fromJson(response, FeedBackBean.class);
                                if (feedBackBean.getSuccess().equals("1")) {
                                    listener.onSuccess(feedBackBean);
                                } else {
                                    listener.onError(feedBackBean.getMessage());
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void submingpian(String token, String name, String params, String image, String qrCode, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.mingpianfankui)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("image", image)
                    .addParams("name", name)
                    .addParams("params", params)
                    .addParams("qrCode", qrCode)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("mingpianfankui", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                FeedBackBean feedBackBean = new Gson().fromJson(response, FeedBackBean.class);
                                if (feedBackBean.getSuccess().equals("1")) {
                                    listener.onSuccess(feedBackBean);
                                } else {
                                    listener.onError(feedBackBean.getMessage());
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getdudaoliebiao(String token, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.dudaoliebiao)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("Dudaoliebiao", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoLieBiaoBean> baseBean = BaseBean.fromJson(response, DuDaoLieBiaoBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getputshuju(String jsonchuan, String token, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.diaoshashangchuan)

                    .addParams("token", token)
                    .addParams("questionnaireStr", jsonchuan)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null) {
                                listener.onSuccess("ture");
                            } else {
                                listener.onError("暂无数据");
                            }
                        }

                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getWenJianInfo(String token, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.wenjianurl)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<StudyDetialBean> baseBean = BaseBean.fromJson(response, StudyDetialBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError("tiaoguowenjuan");
                                    }
                                } else {
                                    listener.onError("tiaoguowenjuan");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getDiaoChaInfo(String token, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.diaochayurl)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DiaoChaInfo> baseBean = BaseBean.fromJson(response, DiaoChaInfo.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError("tiaoguowenjuandiaocha");
                                    }
                                } else {
                                    listener.onError("tiaoguowenjuandiaocha");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * OkHttpRequest
     * 获取首页广告图
     *
     * @param listener
     */
    @Override
    public void getImage(String token, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .get()
                    .url(C.wordsAppUrl)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("sjouyeguanggao", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<WeclomeBean> baseBean = BaseBean.fromJson(response, WeclomeBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取主页banner图
     *
     * @param token
     * @param listener
     */
    @Override
    public void getBannerImage(String token, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.bannerUrl;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<PageMessageBean> baseBean = BaseBean.fromJson(response, PageMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取获客列表
     *
     * @param token
     * @param pageNo
     * @param pageSize
     * @param listener
     */
    @Override
    public void getHuokeList(String token, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.huoke_url;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageNo", pageNo)
                    .addParams("pageSize", pageSize)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("huokeke", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<HuokeBean> baseBean = BaseBean.fromJson(response, HuokeBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * @param token
     * @param knowledgeId
     * @param listener    获取长知识列表
     */
    @Override
    public void getPrombleList(String token, String knowledgeId, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.Promble_url;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("knowledgeId", knowledgeId)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomPrombleBean> baseBean = BaseBean.fromJson(response, ClassRoomPrombleBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 发送问题
     *
     * @param token
     * @param knowledgeId
     * @param remarks
     * @param listener
     */
    @Override
    public void sendPromble(String token, String knowledgeId, String remarks, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.senPromble_url;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("knowledgeId", knowledgeId)
                    .addParams("remarks", remarks)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    String object = MapUtils.getString(map, "message");
                                    listener.onSuccess(object);
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * z长知识列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getKnowList(String token, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.knowledge_url;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageNo", pageNo)
                    .addParams("pageSize", pageSize)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomBean> baseBean = BaseBean.fromJson(response, ClassRoomBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取所有首页应用管理
     *
     * @param token
     * @param listener
     */
    @Override
    public void getAppaltions(String token, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.getAppactionList;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    Log.e("yingyongliebiao", "onResponse: "+response+"   "+map);
                                    List<String> list = (List<String>) MapUtils.getObject(map, "object");
                                    listener.onSuccess(list);
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取首页列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getPageList(String token, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.pageList;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("timestamp", aes)
                    .addParams("token", token)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<PageListBean> baseBean = BaseBean.fromJson(response, PageListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * 获取首页个人信息
     *
     * @param token
     * @param listener
     */
    @Override
    public void getUsers(String token, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.user_url;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("timestamp", aes)
                    .addParams("token", token)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UsersBean> baseBean = BaseBean.fromJson(response, UsersBean.class);

                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getObject() != null) {
                                        String s = new Gson().toJson(baseBean.getObject());
                                        CommonUtils.dakaMap.put("s", s);
                                    }
                                    if (baseBean.getSuccess() == 1) {
                                        Log.e("bingfa", "onResponse: " + "1233");
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取消息列表
     *
     * @param token
     * @param pageNo
     * @param pageSize
     * @param listener
     */
    @Override
    public void getMessageList(String token, String pageNo, String pageSize, String query, String types, String readFlag, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.MessageUrl;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("timestamp", aes)
                    .addParams("token", token)
                    .addParams("pageNo", pageNo)
                    .addParams("pageSize", pageSize)
                    .addParams("query", query)
                    .addParams("types", types)
                    .addParams("readFlag", readFlag)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MessagesBean> baseBean = BaseBean.fromJson(response, MessagesBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * 消息详情
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void getMessageDetail(String token, String id, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.MessageDetialmes;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MessageDetailBean> baseBean = BaseBean.fromJson(response, MessageDetailBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 发布消息
     *
     * @param token
     * @param title
     * @param content
     * @param foreignIds
     * @param listener
     */
    @Override
    public void setMesage(String token, String title, String content, String foreignIds, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.IssueMessage;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("content", content)
                    .addParams("foreignIds", foreignIds)
                    .addParams("title", title)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取消息职级列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getMesageLeve(String token, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.IssuegetMessageleve;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MessageLeveBean> baseBean = BaseBean.fromJson(response, MessageLeveBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取活动列表
     *
     * @param token
     * @param pageNo
     * @param pageSize
     * @param listener
     */
    @Override
    public void getHdList(String token, String pageNo, String pageSize, String query, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.LoadEventAppList;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("pageNo", pageNo)
                    .addParams("pageSize", pageSize)
                    .addParams("query", query)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<HdBean> baseBean = BaseBean.fromJson(response, HdBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取学习列表
     *
     * @param token
     * @param pageSize
     * @param listener
     */
    @Override
    public void getStudyList(String token, String pageSize, String pageNo, String folder, String query, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.LearnList;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("folderId", folder)
                    .addParams("query", query)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Log.e("525252", "onResponse: " + response);
                                BaseBean<StudyBean> baseBean = BaseBean.fromJson(response, StudyBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 学习详情
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void getStudyDetial(String token, String id, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.LearnDetial;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("id", id)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Log.e("shipinxinxi", "onResponse: " + response);
                                BaseBean<StudyDetialBean> baseBean = BaseBean.fromJson(response, StudyDetialBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 保存学习历史记录
     *
     * @param token
     * @param learnId
     * @param startTime
     * @param endTime
     * @param watchTime
     * @param listener
     */
    @Override
    public void saveLearn(String token, String learnId, String startTime, String endTime, String watchTime, final OnHttpListener listener) {
        try {
            String url = C.saveLearn;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("learnId", learnId)
                    .addParams("startTime", startTime)
                    .addParams("endTime", endTime)
                    .addParams("watchTime", watchTime)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 登录接口
     *
     * @param phonenumber
     * @param code
     * @param listener
     */
    @Override
    public void login(String phonenumber, String code, String deviceid, String deviceType, String clientId, final OnHttpListener listener) {
        try {
            String model = Build.MODEL;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            String url = C.loginUrl;
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("mobile", phonenumber)
                    .addParams("code", code)
                    .addParams("key", "1234567812345678")
                    .addParams("timestamp", aes)
                    .addParams("deviceId", deviceid)
                    .addParams("deviceType", deviceType)
                    .addParams("clientId", clientId)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UsersBean> Beans = BaseBean.fromJson(response, UsersBean.class);

                                BaseBean<UserBean> baseBean = BaseBean.fromJson(response, UserBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getObject() != null) {
                                        String s = new Gson().toJson(Beans.getObject());
                                        CommonUtils.dakaMap.put("s", s);
                                    }
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 验证码
     *
     * @param phonenumber
     * @param listener
     */
    @Override
    public void recverCode(String phonenumber, final OnHttpListener listener) {
        try {
            //时间
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");

            String url = C.SendCode;
            //做网络请求
            OkHttpUtils
                    .post()
                    .url(url)
                    .addParams("mobile", phonenumber)
                    .addParams("type", "login")
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("消息", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<logincompanyBean> baseBean = BaseBean.fromJson(response, logincompanyBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 客服电话
     *
     * @param listener
     */
    @Override
    public void kefu(final OnHttpListener listener) {
        try {
            String url = C.GetStandByPhone;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {

                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<CodeBean> baseBean = BaseBean.fromJson(response, CodeBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    //本地服务器上传图片
    @Override
    public void approve(String token, String imgname, File file, final OnHttpListener listener) {
        try {
            String url = C.IdpicUrl;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            //图片上传到服务器
            OkHttpUtils.post()
                    .url(url)
                    .addFile("file", imgname, file)
                    .addParams("timestamp", aes)
                    .addParams("token", token)
                    .addParams("type", "idcardImg")
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("456456", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<IdCardBean> baseBean = BaseBean.fromJson(response, IdCardBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    //认证平台上传图片
    @Override
    public void approveId(Map<String, String> map, File file, final OnHttpListener listener) {
        try {
            String url = C.ocidUrl;
            OkHttpUtils.post()
                    .url(url)
                    .addFile("file", "as", file)
                    .params(map)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {

                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("tupian", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                Gson gson = new Gson();
                                IdBean idcardBean = gson.fromJson(response, IdBean.class);
                                MessageBean message = idcardBean.getMessage();
                                listener.onSuccess(idcardBean);
                            } else {
                                listener.onFailure();
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 上传信息到服务器
     *
     * @param name
     * @param sex
     * @param idcardnumber
     * @param img
     * @param idcardname
     * @param token
     * @param listener
     */
    @Override
    public void uploadmessage(String name, String sex, String idcardnumber, String img, String idcardname, String token, final OnHttpListener listener) {
        try {
            //上传name,sex,等等
            String urlcommint = C.Commit;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("name", name)
                    .addParams("sex", sex)
                    .addParams("idCard", idcardnumber)
                    .addParams("photo", img)
                    .addParams("idCardImg", idcardname)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("tupians", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ComitMessageBean> baseBean = BaseBean.fromJson(response, ComitMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取团队列表
     *
     * @param token
     */
    public void LoadUserTeamAppList(String token, String id, String type, final OnHttpListener listener) {

        try {
            String urlcommint = C.LoadUserTeamAppList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .addParams("type", type)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<TeamListBean> baseBean = BaseBean.fromJson(response, TeamListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 职级统计图数据接口
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void LoadUserRoleStatisticsAppList(String token, String id, final OnHttpListener listener) {
        try {
            String url = C.LoadUserRoleStatisticsAppList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UserRoleStaticBean> baseBean = BaseBean.fromJson(response, UserRoleStaticBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 星级统计
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void LoadUserStartStatisticsAppList(String token, String id, final OnHttpListener listener) {
        try {
            String url = C.LoadUserStartStatisticsAppList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UserStartStaticBean> baseBean = BaseBean.fromJson(response, UserStartStaticBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        Log.e("xingji", "onResponse: " + response);
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * 个人信息
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void LoadUserAppInfo(String token, String id, final OnHttpListener listener) {
        try {
            String urlcommint = C.LoadUserAppInfo;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id",id)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {

                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UsersBean> Beans = BaseBean.fromJson(response, UsersBean.class);

                                BaseBean<UserAppInfoBean> baseBean = BaseBean.fromJson(response, UserAppInfoBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (Beans.getObject() != null) {
                                        String s = new Gson().toJson(Beans.getObject());
                                        CommonUtils.dakaMap.put("s", s);
                                    }
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("无法查看上级信息");
                                }
                            }
                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 职级列表下的人员
     *
     * @param token
     * @param id
     * @param roleMobileId
     * @param listener
     */
    @Override
    public void getRoaleList(String token, String id, String roleMobileId, final OnHttpListener listener) {
        try {
            String urlcommint = C.getRoaleLIst;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .addParams("roleMobileId", roleMobileId)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<TeamListBean> baseBean = BaseBean.fromJson(response, TeamListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 星级列表下的人员
     *
     * @param token
     * @param id
     * @param starLevel
     * @param listener
     */
    @Override
    public void getStartLeveList(String token, String id, String starLevel, final OnHttpListener listener) {
        try {
            String urlcommint = C.getStartLeveLIst;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .addParams("starLevel", starLevel)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<TeamListBean> baseBean = BaseBean.fromJson(response, TeamListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 上传头像
     *
     * @param token
     * @param photo
     * @param listener
     */
    @Override
    public void upLoadImage(String token, String photo, final OnHttpListener listener) {
        try {
            String urlcommint = C.uploadImage;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("photo", photo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 微信
     *
     * @param token
     * @param listener
     */
    @Override
    public void getWeChat(String token, final OnHttpListener listener) {
        try {
            String urlcommint = C.loadSign;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("payway", "wxpay")
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<WeChatBean> baseBean = BaseBean.fromJson(response, WeChatBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 评级列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getRate(String token, final OnHttpListener listener) {
        try {
            String url = C.RateList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<RateListBean> baseBean = BaseBean.fromJson(response, RateListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 下载列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void download(String token, final OnHttpListener listener) {
        try {
            String url = "";
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DownBean> baseBean = BaseBean.fromJson(response, DownBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * 支付宝
     *
     * @param token
     * @param listener
     */
    @Override
    public void getAlipay(String token, final OnHttpListener listener) {
        try {
            String urlcommint = C.loadSign;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(urlcommint)
                    .addParams("payway", "alipay")
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<AlipayBean> baseBean = BaseBean.fromJson(response, AlipayBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 支付成功
     *
     * @param token
     * @param listener
     */
    @Override
    public void getUserPayInfo(String token, final OnHttpListener listener) {
        String url = C.GetUserPayInfo;
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<PaySuccessBean> baseBean = BaseBean.fromJson(response, PaySuccessBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }

                        }
                    });

        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 上传七牛图片所需token
     *
     * @param listener
     */
    @Override
    public void getUploadToken(final OnHttpListener listener) {

        String url = C.GetUploadToken;
        OkHttpUtils.post()
                .url(url)
                .build()
                .execute(new StringCallback() {
                    @Override
                    public void onError(Call call, Exception e) {
                        listener.onFailure();
                    }

                    @Override
                    public void onResponse(String response) {
                        if (response != null && !"".equals(response.trim())) {
                            BaseBean<TokenBean> baseBean = BaseBean.fromJson(response, TokenBean.class);
                            if (baseBean != null && !baseBean.equals("")) {
                                if (baseBean.getSuccess() == 1) {
                                    listener.onSuccess(baseBean.getObject());
                                } else {
                                    listener.onError(baseBean.getMessage());
                                }
                            } else {
                                listener.onError("暂无数据");
                            }
                        }

                    }
                });
    }

    /**
     * 提交反馈
     *
     * @param token
     * @param problemDesc
     * @param feedbackType
     * @param mobileSystem
     * @param mobileModel
     * @param versionNo
     * @param imageStr
     * @param listener
     */
    @Override
    public void subMitFeed(String token, String problemDesc, String feedbackType, String mobileSystem, String mobileModel, String versionNo, String imageStr, final OnHttpListener listener) {

        try {
            String url = C.SaveFeedback;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("problemDesc", problemDesc)
                    .addParams("feedbackType", feedbackType)
                    .addParams("mobileSystem", mobileSystem)
                    .addParams("mobileModel", mobileModel)
                    .addParams("versionNo", versionNo)
                    .addParams("imageStr", imageStr)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            String s = e.toString();
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                FeedBackBean feedBackBean = new Gson().fromJson(response, FeedBackBean.class);
                                if (feedBackBean.getSuccess().equals("1")) {
                                    listener.onSuccess(feedBackBean);
                                } else {
                                    listener.onError(feedBackBean.getMessage());
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 提交反馈
     *
     * @param token
     * @param imageStr
     * @param listener
     */
    @Override
    public void subjubao(String token, String imageStr, String complaintsName, String complaintsContent, final OnHttpListener listener) {

        try {
            String url = C.NiMINGJuBao;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("images", imageStr)
                    .addParams("complaintsName", complaintsName)
                    .addParams("complaintsContent", complaintsContent)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            String s = e.toString();
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                FeedBackBean feedBackBean = new Gson().fromJson(response, FeedBackBean.class);
                                if (feedBackBean.getSuccess().equals("1")) {
                                    listener.onSuccess(feedBackBean);
                                } else {
                                    listener.onError(feedBackBean.getMessage());
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 活动签到
     *
     * @param token
     * @param userId
     * @param eventId
     * @param listener
     */
    @Override
    public void saveEventSign(String token, String userId, String eventId, final OnHttpListener listener) {

        try {
            String url = C.SaveEventSign;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("userId", userId)
                    .addParams("eventId", eventId)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();

                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                SignNameBean signNameBean = new Gson().fromJson(response, SignNameBean.class);
                                if (signNameBean.getSuccess().equals("1")) {
                                    listener.onSuccess(signNameBean);
                                } else {
                                    listener.onError(signNameBean.getMessage());
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    /**
     * 版本更新
     *
     * @param versionCode
     * @param listener
     */
    @Override
    public void VersionUpdate(String versionCode, final OnHttpListener listener) {
        String url = C.VersionUpdate;
        OkHttpUtils.post()
                .url(url)
                .addParams("versionCode", versionCode)
                .build()
                .execute(new StringCallback() {
                    @Override
                    public void onError(Call call, Exception e) {
                        listener.onFailure();
                    }

                    @Override
                    public void onResponse(String response) {
                        if (response != null && !"".equals(response.trim())) {
                            BaseBean<UpdateBean> baseBean = BaseBean.fromJson(response, UpdateBean.class);
                            if (baseBean != null && !baseBean.equals("")) {
                                if (baseBean.getSuccess() == 1) {
                                    listener.onSuccess(baseBean.getObject());
                                } else {
                                    listener.onError(baseBean.getMessage());
                                }
                            } else {
                                listener.onError("暂无数据");
                            }
                        }

                    }
                });
    }

    /**
     * 我的发布消息页
     *
     * @param token
     * @param listener
     */
    @Override
    public void MyissusseMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.MyIssuesList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MessagesBean> baseBean = BaseBean.fromJson(response, MessagesBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }

                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 删除我发布的消息
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void DeleteMyissusseMessage(String token, String id, final OnHttpListener listener) {
        try {
            String url = C.deleteMyIssuesList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("id", id)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取会员列表
     *
     * @param token
     * @param status
     * @param listener
     */
    @Override
    public void getMemberList(String token, String status, final OnHttpListener listener) {
        try {
            String url = C.getMemberlist;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("status", status)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<MemberBean> baseBean = BaseBean.fromJson(response, MemberBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 应用列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getAppList(String token, final OnHttpListener listener) {
        try {
            String url = C.getappList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {

                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<AppListBean> baseBean = BaseBean.fromJson(response, AppListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 保存应用管理
     *
     * @param token
     * @param menuMobileIds
     * @param listener
     */
    @Override
    public void svaeAppa(String token, String menuMobileIds, final OnHttpListener listener) {
        try {
            String url = C.setAppcationList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("menuMobileIds", menuMobileIds)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 打卡列表
     *
     * @param token
     * @param statisticsTime
     * @param listener
     */
    @Override
    public void getSginList(String token, String statisticsTime, final OnHttpListener listener) {
        try {
            String url = C.getSginList;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("statisticsTime", statisticsTime)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<SginchuqinBean> baseBean = BaseBean.fromJson(response, SginchuqinBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 我的打卡列表
     *
     * @param token
     * @param statisticsTime
     * @param listener
     */
    @Override
    public void getSgintwoList(String token, String statisticsTime, final OnHttpListener listener) {
        try {
            String url = C.dakaliest_url_new;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("statisticsTime", statisticsTime)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {

                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<SginchuqinBean> baseBean = BaseBean.fromJson(response, SginchuqinBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        Log.e("dakaxinxixi", "onResponse: " + baseBean.getObject().getList().get(0).getDays());
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取打卡信息
     *
     * @param token
     * @param listener
     */
    @Override
    public void getSginMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.getSginMessage;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<SginMessageBean> baseBean = BaseBean.fromJson(response, SginMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 打卡信息
     *
     * @param token
     * @param listener
     */
    @Override
    public void getSgintwoMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.dakamesage_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<SginTwoMessageBean> baseBean = BaseBean.fromJson(response, SginTwoMessageBean.class);

                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 打卡
     *
     * @param token
     * @param lng
     * @param lat
     * @param address
     * @param listener
     */
    @Override
    public void setDakas(String token, String lng, String lat, String address, final OnHttpListener listener) {
        try {
            String url = C.setSgins;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("lng", lng)
                    .addParams("lat", lat)
                    .addParams("address", address)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 打卡
     *
     * @param token
     * @param lng
     * @param lat
     * @param address
     * @param listener
     */
    @Override
    public void settwoDakas(String token, String lng, String lat, String address, final OnHttpListener listener) {
        try {
            String url = C.dakatwo_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("positionX", lng)
                    .addParams("positionY", lat)
                    .addParams("info", address)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取我的个人信息
     *
     * @param token
     * @param listener
     */
    @Override
    public void getMessages(String token, final OnHttpListener listener) {
        try {
            String url = C.getmessage;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<UsersBean> baseBeans = BaseBean.fromJson(response, UsersBean.class);

                                BaseBean<SetMessageBean> baseBean = BaseBean.fromJson(response, SetMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBeans.getObject() != null) {
                                        String s = new Gson().toJson(baseBeans.getObject());
                                        CommonUtils.dakaMap.put("s", s);
                                    }
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取我提问的问题列表
     *
     * @param token
     * @param pageNo
     * @param pageSize
     * @param listener
     */
    @Override
    public void getMyQuestionList(String token, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String url = C.knowmylist_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageNo", pageNo)
                    .addParams("pageSize", pageSize)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomPrombleBean> baseBean = BaseBean.fromJson(response, ClassRoomPrombleBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 学习历史列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getLearnList(String token,String pageSize, String pageNo, final OnHttpListener listener) {
        try {
            String url = C.Learnload;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<LearnHistoryBean> baseBean = BaseBean.fromJson(response, LearnHistoryBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 保险档案列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void InsuranceList(String token, final OnHttpListener listener) {
        try {
            String url = C.insuranelist_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<InsuranceBean> baseBean = BaseBean.fromJson(response, InsuranceBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 工作日志列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void WorkLogList(String token, String pageSize, String pageNo, final OnHttpListener listener) {
        try {
            String url = C.workloglist_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<WorkLogBean> baseBean = BaseBean.fromJson(response, WorkLogBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 保险档案详情
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void InsuranceMesage(String token, String id, final OnHttpListener listener) {
        try {
            String url = C.inurancemessage_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<InuranceMessageBean> baseBean = BaseBean.fromJson(response, InuranceMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 工作日志详情
     *
     * @param token
     * @param id
     * @param listener
     */
    @Override
    public void WorkLogMesage(String token, String id, final OnHttpListener listener) {
        try {
            String url = C.worklogmessage_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<WorkMessageBean> baseBean = BaseBean.fromJson(response, WorkMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 上传工作日志
     *
     * @param token
     * @param content
     * @param listener
     */
    @Override
    public void upload_Worklog(String id, String token, String content, final OnHttpListener listener) {
        try {
            String url = C.worklog_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .addParams("content", content)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 上传保险档案信息
     *
     * @param companyName
     * @param policyNumber
     * @param policyStatus
     * @param insuredPerson
     * @param insured
     * @param beneficiaries
     * @param transferBank
     * @param transferAccountNumber
     * @param productName
     * @param underwritingTime
     * @param annualPremium
     * @param paymentPeriod
     * @param guaranteePeriod
     * @param insuredAmount
     * @param insuranceDuty
     * @param insuredPersonMobile
     * @param listener
     */
    @Override
    public void upload_insuranceMessage(String id, String companyName, String policyNumber, String policyStatus, String insuredPerson, String token,
                                        String insured, String beneficiaries, String transferBank, String transferAccountNumber, String productName,
                                        String underwritingTime, String annualPremium, String paymentPeriod, String guaranteePeriod, String insuredAmount,
                                        String insuranceDuty, String insuredPersonMobile, final OnHttpListener listener) {
        try {
            String url = C.insurance_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("timestamp", aes)
                    .addParams("token", token)
                    .addParams("id", id)
                    .addParams("companyName", companyName)
                    .addParams("policyNumber", policyNumber)
                    .addParams("policyStatus", policyStatus)
                    .addParams("insuredPerson", insuredPerson)
                    .addParams("insured", insured)
                    .addParams("beneficiaries", beneficiaries)
                    .addParams("transferBank", transferBank)
                    .addParams("transferAccountNumber", transferAccountNumber)
                    .addParams("productName", productName)
                    .addParams("underwritingTime", underwritingTime)
                    .addParams("annualPremium", annualPremium)
                    .addParams("paymentPeriod", paymentPeriod)
                    .addParams("guaranteePeriod", guaranteePeriod)
                    .addParams("insuredAmount", insuredAmount)
                    .addParams("insuranceDuty", insuranceDuty)
                    .addParams("insuredPersonMobile", insuredPersonMobile)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 我的问题列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getmyPromble(String token, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String url = C.knowpromble_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomPrombleBean> baseBean = BaseBean.fromJson(response, ClassRoomPrombleBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 回答问题
     *
     * @param token
     * @param questionId
     * @param remarks
     * @param listener
     */
    @Override
    public void answePromble(String token, String questionId, String remarks, final OnHttpListener listener) {
        try {
            String url = C.answerpromble_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("questionId", questionId)
                    .addParams("remarks", remarks)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Map<String, Object> map = new HashMap<String, Object>();
                                map = JsonUtils.fromJsonToHashMap(response);
                                if (MapUtils.getIntValue(map, "success") == 1) {
                                    listener.onSuccess(MapUtils.getString(map, "message"));
                                } else {
                                    listener.onError(MapUtils.getString(map, "message"));
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getPrombles(String token, String answerStatus, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String url = C.allpromble_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("answerStatus", answerStatus)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomPrombleBean> baseBean = BaseBean.fromJson(response, ClassRoomPrombleBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getstudyList(String token, String pageNo, String pageSize, final OnHttpListener listener) {
        try {
            String url = C.knowstudy_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ClassRoomBean> baseBean = BaseBean.fromJson(response, ClassRoomBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getDaKaMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.dakatongji_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DaKaInfoBean> baseBean = BaseBean.fromJson(response, DaKaInfoBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * huoqutuanduitongji
     *
     * @param token
     * @param listener
     */
    @Override
    public void getTuanduitongji(String token, final OnHttpListener listener) {
        try {
            String url = C.tuanduitongji_url;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<tuanduiBean> baseBean = BaseBean.fromJson(response, tuanduiBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取打卡详情
     *
     * @param token
     * @param punchcardTime
     * @param times
     * @param listener
     */
    @Override
    public void getDaKaXqMessage(String token, String pageSize, String pageNo, String punchcardTime, String times, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .get()
                    .url(C.dakaxiangqing_url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("timestamp", aes)
                    .addParams("punchcardTime", punchcardTime)
                    .addParams("times", times)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DaKaXiqngQingBean> baseBean = BaseBean.fromJson(response, DaKaXiqngQingBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Override
    public void deleteitem(String token, String familyid,final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.baodandeleteitem)
                    .addParams("token", token)
                    .addParams("familyId", familyid)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("kehuliebiao", "onResponse: "+response );
                            Gson gson = new Gson();

                            BaseBean baseBean = gson.fromJson(response, BaseBean.class);

                            if (baseBean != null && !baseBean.equals("")) {
                                if (baseBean.getSuccess() == 1) {
                                    listener.onSuccess("删除成功");
                                } else {
                                    listener.onError(baseBean.getMessage()+C.baodandeleteitem);
                                }
                            } else {
                                listener.onError("暂无数据");
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



    @Override
    public void getBaodankehu(String token, String pageSize, String pageNo, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.baodankehulist)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("kehuliebiao", "onResponse: "+response );
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<BaoDanKehuBean> baseBean = BaseBean.fromJson(response, BaoDanKehuBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



    @Override
    public void subbaodanshuju(String token, String jsonchuan, String familyid,String xiugaiid, final OnHttpListener listener) {
//做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.baodanshujushangchuannew)
                    .addParams("token", token)
                    .addParams("jsonParams", jsonchuan)
                    .addParams("timestamp", aes)
                    .addParams("familyId", familyid)
                    .addParams("id", xiugaiid)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Log.e("shangchuanshujur", "onResponse: " + response);
                                BaseBean<BaoDanTiaoBean> baseBean = BaseBean.fromJson(response, BaoDanTiaoBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void subbaodangereninfo(String token, String jsonchuan, String familyid, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.baodangerenxinxishangchuan)
                    .addParams("token", token)
                    .addParams("jsonParams", jsonchuan)
                    .addParams("timestamp", aes)
                    .addParams("familyId", familyid)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("gerenxinxifaqi", "onResponse: "+response );
                            if (response != null && !"".equals(response.trim())) {
                                Gson gson = new Gson();

                                BaseBean baseBean = gson.fromJson(response, BaseBean.class);

                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess("成功");
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getyiyoushuju(String token, String familyid,String xiugaiid, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            Log.e("gerenxinxifanhui", "getyiyoushuju: " + familyid);

            OkHttpUtils
                    .post()
                    .url(C.baodanhuoqushuju)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("familyId", familyid)
                    .addParams("id", xiugaiid)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("huoqudeshuju", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
//                                Gson gson = new Gson();
//
//                                ShuJuHuixianBean p1 = gson.fromJson(response, ShuJuHuixianBean.class);
//
//                                if (p1 != null && !p1.equals("")) {
//                                    if (p1.getSuccess().equals("1")) {
//                                        listener.onSuccess(p1);
//                                    } else {
//                                        listener.onError(p1.getMessage());
//                                    }
//                                } else {
//                                    listener.onError("暂无数据");
//                                }
                                Log.e("huoqudeshuju", "onResponse: " + response);
                                BaseBean<SubBaoDanShuJuBEan> baseBean = BaseBean.fromJson(response, SubBaoDanShuJuBEan.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            Log.e("gerenxinxifanhui", "getyiyoushuju: " + e.getMessage());
            e.printStackTrace();
        }
    }

    @Override
    public void getbaodangerenshuju(String token, String familyid, final OnHttpListener listener) {
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            Log.e("gerenxinxifanhui", "getyiyoushuju: " + familyid);

            OkHttpUtils
                    .post()
                    .url(C.baodangerenshujuhuixian)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("familyId", familyid)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                Log.e("gerenshujuju", "onResponse: "+response );
                                Gson gson = new Gson();

                                ShuJuHuixianBean p1 = gson.fromJson(response, ShuJuHuixianBean.class);

                                if (p1 != null && !p1.equals("")) {
                                    if (p1.getSuccess().equals("1")) {
                                        listener.onSuccess(p1);
                                    } else {
                                        listener.onError(p1.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }

                            }
                        }
                    });
        } catch (Exception e) {

            e.printStackTrace();
        }
    }

    @Override
    public void getbaodanxuanxiang(String token, String type, final OnHttpListener listener) {
        //做网络请求
        try {
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils
                    .post()
                    .url(C.xuanxiangshuju)
                    .addParams("token", token)
                    .addParams("type", type)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("xuanxiangxinxi", "onResponse: " + response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XuanXiangShuJuBean> baseBean = BaseBean.fromJson(response, XuanXiangShuJuBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取统计消息数据
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxiaoxiMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.xiaoxitongjiurl;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<TongJiMessageBean> baseBean = BaseBean.fromJson(response, TongJiMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取消息列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxiaoxilistMessage(String token, String pageSize, String pageNo, final OnHttpListener listener) {
        try {
            String url = C.xiaoxitongjiliebiao;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XiaoXiXiangQingBean> baseBean = BaseBean.fromJson(response, XiaoXiXiangQingBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取学习统计列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxxuexixilistMessage(String token, String pageSize, String pageNo, final OnHttpListener listener) {
        try {

            String url = C.xuexitongjiliebiao;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");

            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {

                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XueXiListBean> baseBean = BaseBean.fromJson(response, XueXiListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取消息已读未读列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxiaoxifinalMessage(String token, String pageSize, String pageNo, String id, final OnHttpListener listener) {
        try {
            String url = C.xiaoxifinal;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("id", id)
                    .addParams("timestamp", aes)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XiaoXiFinalBean> baseBean = BaseBean.fromJson(response, XiaoXiFinalBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取学习已读未读列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxuexifinalMessage(String token, String pageSize, String pageNo, String id, final OnHttpListener listener) {
        try {
            String url = C.xuexifinal;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("id", id)
                    .addParams("timestamp", aes)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XueXiFinalBean> baseBean = BaseBean.fromJson(response, XueXiFinalBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 统计页面 学习数据
     *
     * @param token
     * @param listener
     */
    @Override
    public void getxiuexiMessage(String token, final OnHttpListener listener) {
        try {
            String url = C.xiueixtongjiurl;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<XueXiMessageBean> baseBean = BaseBean.fromJson(response, XueXiMessageBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取学习分类文件夹
     *
     * @param token
     * @param listener
     */
    @Override
    public void gettudyGuoDu(String token, String pageSize, String pageNo, final OnHttpListener listener) {
        try {
            String url = C.xuexifenlei;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("pageSize", pageSize)
                    .addParams("pageNo", pageNo)
                    .addParams("timestamp", aes)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<xuexifenleiBean> baseBean = BaseBean.fromJson(response, xuexifenleiBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取首页法商数据
     *
     * @param token
     * @param listener
     */
    @Override
    public void getOFO(String token, final OnHttpListener listener) {
        try {
            String url = C.shouyeofo;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ShouyeOFOBean> baseBean = BaseBean.fromJson(response, ShouyeOFOBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getdudaolist(String token, String Datas, final OnHttpListener listener) {
        try {
            String url = C.dudaotongji;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("dateStr", Datas)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoBean> baseBean = BaseBean.fromJson(response, DuDaoBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导列表
     *
     * @param token
     * @param listener
     */
    @Override
    public void getzaohuilist(String token, String Datas, final OnHttpListener listener) {
        try {
            String url = C.zaohuilist;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("dateStr", Datas)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<ZaoHuiList> baseBean = BaseBean.fromJson(response, ZaoHuiList.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导xiangqing
     *
     * @param token
     * @param listener
     */
    @Override
    public void getdudaoxiangqing(String token, String ticketMain, String bodyMain, String guestsPresent, String transactionMain, String mainList,
                                  String doubleIncomeMainBody, String transactionNumber,
                                  String orderNumber, String preminu, String voucherNumber, String referralNumber, String listNumber, String increaseNumber, final OnHttpListener listener) {
        try {
            String url = C.dudaoshangchuan;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("ticketMain", ticketMain)
                    .addParams("bodyMain", bodyMain)
                    .addParams("guestsPresent", guestsPresent)
                    .addParams("transactionMain", transactionMain)
                    .addParams("mainList", mainList)
                    .addParams("doubleIncomeMainBody", doubleIncomeMainBody)
                    .addParams("transactionNumber", transactionNumber)
                    .addParams("orderNumber", orderNumber)
                    .addParams("preminu", preminu)
                    .addParams("voucherNumber", voucherNumber)
                    .addParams("referralNumber", referralNumber)
                    .addParams("listNumber", listNumber)
                    .addParams("increaseNumber", increaseNumber)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoXiangQingBean> baseBean = BaseBean.fromJson(response, DuDaoXiangQingBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导xiangqing
     *
     * @param token
     * @param listener
     */
    @Override
    public void getdangtiandudao(String token, final OnHttpListener listener) {
        try {
            String url = C.dudaodangtiasnhuju;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoXiangQingBean> baseBean = BaseBean.fromJson(response, DuDaoXiangQingBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导xiangqing
     *
     * @param token
     * @param listener
     */
    @Override
    public void getdangtianzaohui(String token, final OnHttpListener listener) {
        try {
            String url = C.dudaodangtianzaohui;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoZaohuiShuJU> baseBean = BaseBean.fromJson(response, DuDaoZaohuiShuJU.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取督导xiangqing
     *
     * @param token
     * @param listener
     */
    @Override
    public void getzaohuishangbao(String token, String number1, String number2, String number3, final OnHttpListener listener) {
        try {
            String url = C.dudaozaohuishangbao;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("number1", number1)
                    .addParams("number2", number2)
                    .addParams("number3", number3)

                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<DuDaoZaohuiShuJU> baseBean = BaseBean.fromJson(response, DuDaoZaohuiShuJU.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void getyejixiangqing(String token, String id,String data, final OnHttpListener listener) {
        try {
            String url = C.yejichaxunxiangqing;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .addParams("date", data)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("yejichaxun", "onResponse: "+ response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<YeJiXiangQingBean> baseBean = BaseBean.fromJson(response, YeJiXiangQingBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Override
    public void getyejilist(String token, String pageSize, String pageNo,  String data, final OnHttpListener listener) {
        try {
            String url = C.yejichaxunlist;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("date", data)


                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("yejichaxun", "onResponse: "+ response);
                            if (response != null && !"".equals(response.trim())) {
                                BaseBean<YeJiListBean> baseBean = BaseBean.fromJson(response, YeJiListBean.class);
                                if (baseBean != null && !baseBean.equals("")) {
                                    if (baseBean.getSuccess() == 1) {
                                        listener.onSuccess(baseBean.getObject());
                                    } else {
                                        listener.onError(baseBean.getMessage());
                                    }
                                } else {
                                    listener.onError("暂无数据");
                                }
                            }
                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Override
    public void deletebaodan(String token ,String id, final OnHttpListener listener) {
        try {
            String url = C.baodandeleteyizhang;
            String mtime = makeTime.mtime();
            String aes = AesUtils.encryptAES(mtime, "1234567812345678");
            OkHttpUtils.post()
                    .url(url)
                    .addParams("token", token)
                    .addParams("timestamp", aes)
                    .addParams("id", id)
                    .build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            listener.onFailure();
                        }

                        @Override
                        public void onResponse(String response) {
                            Log.e("yejichaxun", "onResponse: "+ response);

                                if (response != null && !"".equals(response.trim())) {
                                    FeedBackBean feedBackBean = new Gson().fromJson(response, FeedBackBean.class);
                                    if (feedBackBean.getSuccess().equals("1")) {
                                        listener.onSuccess("成功");
                                        Log.e("yejichaxun", "onResponse:成功 ");

                                    } else {
                                        listener.onError(feedBackBean.getMessage());
                                    }
                                }

                        }
                    });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}